package hammersmith.local.valueobjects;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * Article-Klasse
 * 
 * @author hammersmith
 * 
 */
public class Article implements Serializable {

	private static long maxId = 0;

	private static final long serialVersionUID = 7477241584219207499L;

	private long id;
	private String name;
	private String description;
	private int stock;
	private String size;
	private float price;
	private String color;
	private String type;

	public Timestamp getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Timestamp createDate) {
		this.createDate = createDate;
	}

	private Timestamp createDate;

	private String imagePath;

	public Article() {

	}

	public Article(String n, String d, int s, String sz, float p, String c,
			String t, String imagePath) {
		this.id = ++maxId;
		this.name = n;
		this.description = d;
		this.size = sz;
		this.stock = s;
		this.price = p;
		this.color = c;
		this.type = t;
		this.imagePath = imagePath;
		this.createDate = new Timestamp(System.currentTimeMillis());
	}

	public String getColor() {
		return this.color;
	}

	public String getDescription() {
		return this.description;
	}

	public String getImagePath() {
		return imagePath;
	}

	public void setImagePath(String imagePath) {
		this.imagePath = imagePath;
	}

	public long getId() {
		return this.id;
	}

	public String getName() {
		return this.name;
	}

	public float getPrice() {
		return this.price;
	}

	public String getSize() {
		return this.size;
	}

	public int getStock() {
		return this.stock;
	}

	public String getType() {
		return type;
	}

	public void setColor(String c) {
		this.color = c;
	}

	public void setDescription(String d) {
		this.description = d;
	}

	public void setId(long i) {
		this.id = i;
		if (this.id > maxId)
			maxId = this.id;
	}

	public void setName(String n) {
		this.name = n;
	}

	public void setPrice(float p) {
		this.price = p;
	}

	public void setSize(String sz) {
		this.size = sz;
	}

	public void setStock(int s) {
		this.stock = s;
	}

	public void setType(String type) {
		this.type = type;
	}

}
